<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 算是 独立完成 美滋滋 有点小瑕疵
        //工资的数组[1500,1200,2000,2100,2100,1800],把工资超过2000的删除
        // 2000也算 2000不删除的话就把等于号去掉
        var gz = [1500, 1200, 2000, 2100, 2100, 1800];
        for (var j = 1; j < gz.length; j++) {
            for (var i = 0; i < gz.length; i++) {
                if (gz[i] > 2000) {
                    gz.splice(i, 1);
                }
            }
        }

        console.log(gz);
    </script>
</body>

</html>